<?php

namespace App\Http\Requests;


class UserRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            "username" => "required|unique:user|max:30",
            "password" => "required|max:50"
        ];
    }

    public function messages()
    {
        return [
            "username.required" => "用户名不能为空",
            "username.unique" => "已有用户名,请重新输入",
            "username.max" => "用户名不能超过最大长度",
            "password.required" => "密码不能为空",
            "password.max" => "密码不能超过最大长度",
        ];
    }
}
